function [  all,  c, ax, vx  ] = GTCCxx( ad_x, sr , broaden )	
    
	bPreem      = 1;           
	dFrameLen    = 0.0256;     %dlzka ramca
	dSampRate    = sr;         %vzorkovacia
	dFramePeriod = 0.010;      %prekrivanie

	iFL        = floor(dFrameLen    * dSampRate);
	iFP        = floor(dFramePeriod * dSampRate);
	nframes = floor((length(ad_x) - iFL) / iFP) + 1;
    
    iSpeechLen = length(ad_x);
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%
	% Pre-emphasis using H(z) = 1 - 0.97 z ^ -1
	%
	if (bPreem == 1)
		ad_x = filter([1 -0.97], 1, ad_x);      
    end
  
	iFFTSize  = 1024;
	nbands = 40;
  
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%
	% Obtaning the gammatone coefficient. 
	%
    % Based on M. Snelly's auditory toolbox. 
    % In actual C-implementation, we just use a table
    %
 	aad_H = ComputeFilterResponsexx_GTCC(nbands, iFFTSize);
	aad_H = abs(NormalizeFilterGainxx_GTCC(aad_H));
    
	i_FI = 0;
    adSumPower = zeros(1, nframes);
	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%
	% Obtaining the short-time Power P(i, j)
	%
	for m = 0 : iFP : iSpeechLen  - iFL 
		ad_x_st                = ad_x(m + 1 : m + iFL) .* hamming(iFL);
        adSpec                 = fft(ad_x_st, iFFTSize);
        ad_X                   = abs(adSpec(1: iFFTSize / 2));
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        %
        % Calculating the Power P(i, j)
        %
        for j = 1 : nbands
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                %
                % Squared integration
                %
                aad_P( j , i_FI + 1)  = sum((ad_X .* aad_H(:, j)) .^ 2);
        end

        adSumPower(i_FI + 1) = sum(aad_P( : , i_FI + 1));
        i_FI = i_FI + 1;
    end   
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
	%
	% Peak Power Normalization Using 95 % percentile
	%
	adSorted = sort(adSumPower);
	dMaxPower = adSorted(round(0.95 * length(adSumPower)));
	aad_P = aad_P / dMaxPower * 1e4;   
    
    EarQ = 9.26449;
    minBW = 24.7;
    dLowFreq    = 130.0;
    dHighFreq   = 6800.0;

    cf = -(EarQ*minBW) + exp((1:nbands)'*(-log(dHighFreq + EarQ*minBW) + ...
            log(dLowFreq + EarQ*minBW))/nbands) * (dHighFreq + EarQ*minBW);
cf = cf';
cf = fliplr(cf);   %stredne frekvencie 

    % Hynek's magic equal-loudness-curve formula
    fsq = cf.^2;
    ftmp = fsq + 1.6e5;
    eql = ((fsq./ftmp).^2) .* ((fsq + 1.44e6)./(fsq + 9.61e6));
    z = repmat(eql',1,nframes).*aad_P;
if (broaden)
  y = z([1,1:nbands,nbands],:);
else
  y = z([2,2:(nbands-1),nbands-1],:);
end


aadSpec = log(y');
    

c = dct(aadSpec');
c(14:nbands, :) = [];
for i = 1 : 13
           c(i, : ) = c(i, : ) - mean(c(i, : ));
end

nf=size(c,2);
nc=13;

c=c';

  vf=(4:-1:-4)/60;
  af=(1:-1:-1)/2;
  ww=ones(5,1);
  cx=[c(ww,:); c; c(nf*ww,:)];
  vx=reshape(filter(vf,1,cx(:)),nf+10,nc);
  vx(1:8,:)=[];
  ax=reshape(filter(af,1,vx(:)),nf+2,nc);
  ax(1:2,:)=[];
  vx([1 nf+2],:)=[];  
  all=[c vx ax];
  
  c=c';             %zakladne
  ax=ax';           %akceleracne
  vx=vx';           %diferencne
  all=all';         %vsetky 39
end
